<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:h="http://java.sun.com/jsf/html">

<body>
	<ui:composition template="./../template.xhtml">

		<ui:define name="right">

		</ui:define>

		<ui:define name="center">
			<h2>#{bundle.Genes}</h2>

			<p:panel header="#{bundle.CreateGeneList}">
				<h:form id="form">

					<p:dataTable id="genes" var="gene"
						value="#{geneController.geneLazyList}" rowKey="#{gene.id}"
						paginator="true" rows="10" lazy="true"  rowStyleClass="lista"
						emptyMessage="Nessun gene nel database">

						<p:column headerText="#{bundle.CreateGeneTitle_id}"
							filterBy="#{gene.id}" filterMatchMode="contains">
							<h:outputText value="#{gene.id}" />
						</p:column>

						<p:column headerText="#{bundle.CreateGeneTitle_geneSymbol}"
							filterBy="#{gene.geneSymbol}" filterMatchMode="contains">
							<h:outputText value="#{gene.geneSymbol}" />
						</p:column>

						<p:column headerText="#{bundle.CreateGeneTitle_organism}">
							<h:outputText value="#{gene.orgName}" />
						</p:column>

						<p:column headerText="#{bundle.CreateGeneTitle_status}">
							<h:outputText value="#{gene.status}" />
						</p:column>

						<p:column>
							<h:panelGrid columns="3" cellpadding="2">
						
								<p:commandButton update="genDetail" oncomplete="genDialog.show()"
									image="ui-icon ui-icon-search">
									<f:setPropertyActionListener value="#{gene}"
										target="#{geneController.gene}" />
								</p:commandButton>
							</h:panelGrid>
						</p:column>

					</p:dataTable>


					<p:dialog header="Car Detail" widgetVar="genDialog" width="200"
						height="200" modal="true">

							<h:panelGrid  id="genDetail" columns="2" cellpadding="5">
								<h:outputLabel for="status"
									value="#{bundle.CreateGeneLabel_description} " />
								<h:outputText id="status" value="#{gene.description}" />

								<h:outputLabel for="chromosome"
									value="#{bundle.CreateGeneLabel_chromosome} " />
								<h:outputText id="chromosome" value="#{gene.chromosome}" />

								<h:outputLabel for="mapLocation"
									value="#{bundle.CreateGeneLabel_mapLocation} " />
								<h:outputText id="mapLocation" value="#{gene.mapLocation}" />

								<h:outputLabel for="otherDesignation"
									value="#{bundle.CreateGeneLabel_otherDesignation} " />
								<h:outputText id="year" value="#{gene.otherDesignation}" />

								<h:outputLabel for="nomenclatureS"
									value="#{bundle.CreateGeneLabel_nomenclatureStatus} " />
								<h:outputText id="nomenclatureS"
									value="#{gene.nomenclatureStatus}" />

								<h:outputLabel for="taxId"
									value="#{bundle.CreateGeneLabel_taxId} " />
								<h:outputText id="taxId" value="#{gene.taxId}" />

								<h:outputLabel for="summary"
									value="#{bundle.CreateGeneLabel_summary} " />
								<h:outputText id="summary" value="#{gene.summary}" />

								<h:outputLabel for="chrSort"
									value="#{bundle.CreateGeneLabel_chrSort} " />
								<h:outputText id="chrSort" value="#{gene.chrSort}" />

								<h:outputLabel for="chrStart"
									value="#{bundle.CreateGeneLabel_chrStart} " />
								<h:outputText id="chrStart" value="#{gene.chrStart}" />

								<h:outputLabel for="nomenclatureN"
									value="#{bundle.CreateGeneLabel_nomenclatureName} " />
								<h:outputText id="nomenclatureN"
									value="#{gene.nomenclatureName}" />
							</h:panelGrid>
						

					</p:dialog>

				</h:form>
			</p:panel>

		</ui:define>

	</ui:composition>
</body>
</html>
